import request from '@/utils/request'
const base = 'log/requesttrackinglog'

/**
 * 查询RequestTrackingLog数据列表
 * @param {Object} query - 查询参数
 * @returns {Promise} - Axios请求的Promise对象
 */
export function listRequestTrackingLog(query) {
  return request({
    url: `${base}/list`,
    method: 'get',
    params: query
  })
}

/**
 * 查询RequestTrackingLog数据详细
 * @param {number} id - RequestTrackingLog的唯一标识
 * @returns {Promise} - Axios请求的Promise对象
 */
export function getRequestTrackingLog(id) {
  return request({
    url: `${base}/${id}`,
    method: 'get'
  })
}


/**
 * 新增RequestTrackingLog数据
 * @param {Object} data - 新增的RequestTrackingLog数据
 * @returns {Promise} - Axios请求的Promise对象
 */
export function addRequestTrackingLog(data) {
  return request({
    url: `${base}`,
    method: 'post',
    data: data
  })
}

/**
 * 修改RequestTrackingLog数据
 * @param {Object} data - 修改的RequestTrackingLog数据
 * @returns {Promise} - Axios请求的Promise对象
 */
export function updateRequestTrackingLog(data) {
  return request({
    url: `${base}`,
    method: 'put',
    data: data
  })
}

/**
 * 删除RequestTrackingLog数据
 * @param {number|number[]} ids - 要删除的RequestTrackingLog的ID，支持单个ID或ID数组
 * @returns {Promise} - Axios请求的Promise对象
 */
export function delRequestTrackingLog(ids) {
  return request({
    url: `${base}`,
    method: 'delete',
    data: ids   // 将ids放入对象中，确保传递正确
  })
}

/**
 * 一键清空RequestTrackingLog数据
 * @returns {Promise} - Axios请求的Promise对象
 */
export function clearRequestTrackingLog() {
  const clearUrl = `${base}/clear`;
  return request({
    url: clearUrl,
    method: 'delete'
  });
}



/**
 * 获取RequestTrackingLog图标数据集
 * @returns {Promise} - Axios请求的Promise对象
 */
export function chartRequestTrackingLog() {
  const url = `${base}/chart`;
  return request({
    url: url,
    method: 'get'
  });
}

